import logging
from SceneCheckTool.checkScript.CheckBase import CheckBase

try:
    import maya.cmds as cmds
    # import pymel.core as pm
except:
    pass

logging.basicConfig()
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)


class CheckMayaUnit(CheckBase):
    def __init__(self):
        super(CheckMayaUnit, self).__init__()
        pass

    def check(self):
        current_unit = cmds.currentUnit(q=True, linear=True)
        if not current_unit == 'cm':
            result_log = u'Error:请检查，当前Maya单位不是cm。'
        else:
            result_log = u'Succeed:没有问题\n'

        return result_log

    # def fix(self):
        # current_unit = cmds.currentUnit(q=True, linear=True)


